cmake_minimum_required(VERSION 3.20)
project(helloworld)
 
# 设置c++ 标准为c++ 17
set(CMAKE_CXX_STANDARD 17)
 
# 查找 oatpp 和线程  依赖
find_package(oatpp REQUIRED)
find_package(oatpp-websocket REQUIRED)
find_package(Threads REQUIRED)

set(CMAKE_CXX_FLAGS "-I/usr/include/mysql")
add_executable(myController Mysqlutil/StudentMapper.cpp chat/WSInstanceListener.cpp App.cpp chat/WSListener.cpp )

# 将目标文件与库文件进行链接
target_link_libraries(myController -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lzstd -lssl -lcrypto -lresolv -lm)
target_link_libraries(myController oatpp::oatpp)
target_link_libraries(myController oatpp::oatpp-websocket)